package org.lc.solon.cmd;

import org.lc.solon.cmd.plugin.anno.Cmd;
import org.lc.solon.cmd.plugin.anno.CmdField;
import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.annotation.Param;

import java.util.List;

@Controller
@Mapping("test")
// @Cmd(value = "test", description = "测试类") // 可自行放开本行注释来体验效果，或者继承此类后加上注解
public class TestController {
    @Mapping("1")
    @Cmd(value = "n", description = "测试方法")
    public String  test(@Param("name") String name, List<String> strs, User user, List<User> users,
                 @CmdField(required = true) String info) {
        return "test " + name;
    }

    private static class User {
        boolean login;

        String name;

        Family family;

        List<Family> families;

    }

    private static class Family {
        String father;

        String mother;
    }
}